Skip to content

test: copyedit test-tls-psk-alpn-callback-exception-handling#63485

Open
aduh95 wants to merge 1 commit into
nodejs:mainfrom
aduh95:test-tls-psk-alpn-callback-exception-handling
Open

test: copyedit test-tls-psk-alpn-callback-exception-handling#63485
aduh95 wants to merge 1 commit into
nodejs:mainfrom
aduh95:test-tls-psk-alpn-callback-exception-handling

Conversation

@aduh95

@aduh95 aduh95 commented May 22, 2026

Copy link
Copy Markdown
Contributor

Make the assertions more intention revealing

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels May 22, 2026
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (e11b945) to head (da7d903).
⚠️ Report is 382 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63485      +/-   ##
==========================================
- Coverage   90.14%   90.14%   -0.01%     
==========================================
  Files         718      718              
  Lines      227734   227734              
  Branches    42760    42757       -3     
==========================================
- Hits       205289   205280       -9     
- Misses      14219    14245      +26     
+ Partials     8226     8209      -17     

see 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aduh95 aduh95 requested a review from mcollina May 26, 2026 15:25
@aduh95 aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. label May 26, 2026
@aduh95 aduh95 requested a review from Renegade334 July 2, 2026 08:40
server.on('secureConnection', () => {
reject(new Error('secureConnection should not fire'));
});
server.on('secureConnection', common.mustNotCall('secureConnection listener'));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if this fires while promise is being awaited at the end of the test function, and tlsClientError doesn't fire? Seems like the event will be handled outside of the test's promise task, promise won't be resolved or rejected, and the test will hang until timeout?

@aduh95 aduh95 Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node/test/common/index.js

Lines 563 to 572 in 5922197

function mustNotCall(msg) {
const callSite = getCallSites()[1];
return function mustNotCall(...args) {
const argsInfo = args.length > 0 ?
`\ncalled with arguments: ${args.map((arg) => inspect(arg)).join(', ')}` : '';
assert.fail(
`${msg || 'function should not have been called'} at ${callSite.scriptName}:${callSite.lineNumber}` +
argsInfo);
};
}

It would throw an unhandled rejection which would terminate the process immediately
In any case, a pending promise is not enough to keep the process alive, so no the test won't hang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants